package com.ipc.app.util.converter;

import com.ipc.app.dal.doObject.CarDO;
import com.ipc.app.model.Car;

/**
 * @author haijie.zhang
 * 
 */
public class CarConverter {

	public static CarDO carCoreToDO(Car car) {
		CarDO carDO = new CarDO();
		carDO.setCarId(car.getCarId());
		carDO.setCarType(car.getCarType());
		carDO.setUserId(car.getUserId());
		carDO.setCarLicense(car.getCarLicense());
		return carDO;
	}

	public static Car carDOToCore(CarDO carDO) {
		if (null == carDO) {
			return null;
		}
		Car car = new Car();
		car.setCarId(carDO.getCarId());
		car.setCarType(carDO.getCarType());
		car.setCreateTime(carDO.getCreateTime());
		car.setModifyTime(carDO.getModifyTime());
		car.setUserId(carDO.getUserId());
		car.setCarLicense(carDO.getCarLicense());
		return car;
	}
}
